package com.borko.healthcare.persistence.hibernate.services;

import java.util.List;

import com.borko.healthcare.entities.interfaces.Supplier;
import com.borko.healthcare.persistence.hibernate.dao.SupplierDAO;

public class SupplierManagerImpl implements SupplierManager {
	
	private SupplierDAO supplierDAO;

	public SupplierDAO getSupplierDAO() {
		return this.supplierDAO;
	}

	public void setSupplierDAO(SupplierDAO supplierDAO) {
		this.supplierDAO = supplierDAO;
	}

	public void add(Supplier supplier) {
		supplierDAO.create(supplier);
	}

	public void applyChanges(Supplier supplier) {
		supplierDAO.update(supplier);
	}

	public List<Supplier> list() {
		return supplierDAO.retrive();
	}

	public void remove(Supplier supplier) {
		supplierDAO.delete(supplier);
	}

	public Supplier getSupplier(int id) {
		return supplierDAO.getSupplier(id);
	}

}
